#! /bin/bash
. ./common.sh

# https://gitee.com/lgf1244/HomebrewCN/blob/master/Homebrew.sh
# https://www.linuxmi.com/linux-homebrew-brew.html
# https://zhuanlan.zhihu.com/p/111014448

if ! command -v brew  >/dev/null 2>&1; then
    info "not installed homebrew, will install it now!"
    si build-essential procps curl file git zsh bash
    # bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    # zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
    rm -f Homebrew.sh
    # wget https://gitee.com/lgf1244/HomebrewCN/raw/master/Homebrew.sh
    wget https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh
    bash Homebrew.sh
    git config --global --add safe.directory /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core
    brew -v
fi